{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "cf9a11e5",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a0df4344",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    name    code\n",
      "33  化学制药  881140\n",
      "81  医药商业  881143\n",
      "86    中药  881141\n",
      "半导体   881121\n",
      "白酒   881273\n",
      "白色家电   881131\n",
      "保险   881156\n",
      "包装印刷   881138\n",
      "厨卫电器   881174\n",
      "电池   881281\n",
      "电机   881277\n",
      "电力   881145\n",
      "电网设备   881278\n",
      "多元金融   881283\n",
      "电子化学品   881172\n",
      "房地产   881153\n",
      "风电设备   881280\n",
      "非金属材料   881167\n",
      "服装家纺   881136\n",
      "纺织制造   881135\n",
      "工程机械   881268\n",
      "光伏设备   881279\n",
      "贵金属   881169\n",
      "轨交设备   881269\n",
      "港口航运   881148\n",
      "公路铁路运输   881149\n",
      "钢铁   881112\n",
      "光学光电子   881122\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import akshare as ak\n",
    "\n",
    "df0 = ak.stock_board_industry_name_ths()\n",
    "# print(df0[df0['code'].str.contains('综合')])\n",
    "print(df0[df0['name'].str.contains('药')])\n",
    "str = ''\n",
    "# for i in range(75, 90):\n",
    "for i in range(0, 25):\n",
    "# for i in range(25, 50):\n",
    "# for i in range(50, 75):\n",
    "# for i in range(75, 90):\n",
    "  str += df0[df0['name'].str.contains('')]['name'][i] + '   ' +  df0[df0['code'].str.contains('')]['code'][i] + '\\n'\n",
    "  # print(df0[df0['name'].str.contains('')]['name'][i])\n",
    "\n",
    "print(str)\n",
    "# stock_board_industry_index_ths_df = ak.stock_board_industry_index_ths(symbol=\"白色家电\", start_date=\"20240101\", end_date=\"20240718\")\n",
    "# print(stock_board_industry_index_ths_df)\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
